package com.dbh.design.factory.method;

import com.dbh.design.factory.entity.Mouse;

/**
 * FactoryMethodDemo
 * 工厂方法
 *      优点：遵循开闭原则
 *            对客户端隐藏对象的创建细节
 *            遵循单一职责
 *
 *      缺点：添加子类的时候“拖家带口”
 *            只支持同一类产品的创建
 *
 *
 * @author dongbanghui
 * @date 2021/07/23
 */
public class FactoryMethodDemo {

    public static void main(String[] args) {
        MouseFactory mf = new HpMouseFactory();
        Mouse mouse = mf.createMouse();
        mouse.sayHi();
    }

}
